/*
 * Position.h
 *
 *  Created on: May 7, 2013
 *      Author: Daniel
 */

#ifndef POSITION_H_
#define POSITION_H_

#include <string>

class Position
{
private:
	double 	x, z;
	double	xold, zold;
public:
	Position();
	Position(double, double);
	virtual ~Position();

	// Getters
	double 	getX();
	double 	getZ();

	// Setters
	void   	setX(double);
	void	setZ(double);

	void	addX(double);
	void	addZ(double);

	double	distance(Position *);	//Calculate distance to other vector
	void	add(Position *);		//Add to the vector
	void	sub(Position *);		//Subtract from the vector
	double	mag();					//Calculate the vector magnitude
	void	div(double);			//Scale the vector with division
	void	mul(double);			//Scale the vector with multiplication
	void	normalize();			//normalize the vector
	void	setMag(double);
	static Position sub(Position *, Position *);
	double 	angle(Position *);

	void	backup();
	void	restore();

	std::string	toString();
};

#endif /* POSITION_H_ */
